package mn.idax.exchange.otc.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;
import org.omg.CORBA.UNKNOWN;

/**
 * @Auther: dison
 * @Date: 2018/8/22 14:36
 * @Description:
 */
@Getter
@AllArgsConstructor
public enum RequestSourceEnum {

    PC(1,"PC"),
    IOS(2,"IOS"),
    ANDROID(3,"ANDROID"),
    H5(4,"H5"),

    Other(5,"OTHER"),
    ;

    private Integer code;

    private String detail;
    
    public static Integer getSourceCode(String detail){
        for (RequestSourceEnum value : RequestSourceEnum.values()) {
            if (value.getDetail().equalsIgnoreCase(detail)){
                return value.getCode();
            }
        }

        return Other.code;
    }


}
